<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>企业信息类别编辑</title>
<link href="<%=basePath%>skin/css/validform/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="<%=basePath%>skin/js/jquery-1.9.1.min.js"></script>
<script type="text/javascript" src="<%=basePath%>skin/js/validform/Validform_v5.3.2_min.js"></script>
<script type="text/javascript" src="<%=basePath%>skin/js/common.js"></script>
<script language="javascript">
	$().ready(function(){
		//验证
		var validform = $("#form1").Validform({
			btnSubmit:"#save",
			tiptype:3,
			beforeSubmit:function(curform){
				var belongto = $("#belongto").val();
				if (belongto == null || belongto == "") {
					alert("请选择归属!");
					return false;
				}
			}
		});
		validform.addRule([
			{
			    ele:"#orders",
			    datatype:"n",
			    nullmsg:"请输入排序！"
			},		                   
			{
			    ele:"#type",
			    datatype:"*",
			    nullmsg:"请输入类别！"
			}
		]);
	 });	
</script>
</head>

<body>
	<form id="form1" name="form1" method="post" action="<%=basePath%>admin/companyinfoType/update.shtml">
	<input type="hidden" name="id" value="${companyinfoType.id}" />
		<table width="98%" class="input tabContent">
			<tr bgcolor="#FAFAF1" height="22">
				<td class="tdRight">排序：</td>
				<td class="tdLeft"><input id="orders" name="orders"
					size="30" class="input" value="${companyinfoType.orders}"/></td>
			</tr>
			<tr bgcolor="#FAFAF1" height="22">
				<td class="tdRight">类别：</td>
				<td class="tdLeft"><input id="type" name="type"
					size="30" class="input" value="${companyinfoType.type}"/></td>
			</tr>
			<tr bgcolor="#FAFAF1" height="22">
				<td class="tdRight">网址：</td>
				<td class="tdLeft"><input id="url" name="url"
					size="30" class="input" value="${companyinfoType.url}"/></td>
			</tr>
			<tr bgcolor="#FAFAF1" height="22">
				<td class="tdRight">归属：</td>
				<td class="tdLeft">
					<select name="belongto" id="belongto">
						<option value=""></option>
						<c:forEach items="${belongtos}" var="belongto">
				  			<option value="${belongto.key}" <c:if test="${companyinfoType.belongto == belongto.key }">selected</c:if>>${belongto.value}</option>
			  			</c:forEach>
					</select>
				</td>
			</tr>
		</table>
		<table width="98%">
			<tr bgcolor="#EEF4EA">
				<td height="36" colspan="10">
					<input type="button" value="确定" class="button" id="save" />
					<input type="button" value="返回" class="button" onclick="location.href='<%=basePath%>admin/companyinfoType/list.shtml'" />
				</td>
			</tr>
		</table>
	</form>
</body>
</html>
